package com.bkaka.dao;

import com.bkaka.entity.ExamQuestion;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by maxiaoqiang on 2018/9/3.
 */
public interface ExamQuestionDao {

    // 根据科目ID 和 章节ID 查找
    List<ExamQuestion> findAll(@Param("examSubjectId") Integer examSubjectId, @Param("examChapterId") Integer examChapterId);


    List<ExamQuestion> findByRule(
            @Param("examSubjectId") Integer examSubjectId,
            @Param("examChapterId") Integer examChapterId,
            @Param("type") Integer type,
            @Param("level") Integer level,
            @Param("limit") Integer limit
    );

    List<ExamQuestion> examQuestions(@Param("examPaperId") Integer examPaperId, @Param("ids") List ids);

    List<ExamQuestion> examMistake(@Param("examSubjectId") Integer examSubjectId,@Param("examChapterId") Integer examChapterId,@Param("userId") Integer userId);

    ExamQuestion findById(@Param("id") Integer id);


    // 添加问题
    void create(ExamQuestion question);

    // 删除
    boolean delete(@Param("id") Integer id);

    // 更新
    void update(ExamQuestion question);

}
